﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Ecommerce.Migrations
{
    public partial class AddTbOrderState : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "tbOrderInfos",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    OrderInfoTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    PayWayInfoId = table.Column<int>(type: "int", nullable: false),
                    MemberId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OrderInfoAddre = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OrderInfoName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ShoppAddreTel = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OrderInfoSalePrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    CommodCountPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    OrderInfoBarCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OrderInfoPayPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    OrderInfoActiveName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OrderDiscount = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    OrderPrivilPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    OrderInfoActivePrice = table.Column<int>(type: "int", nullable: false),
                    OrderInvoiceM = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OrderInfoState = table.Column<int>(type: "int", nullable: false),
                    OrderInfoWaybillNum = table.Column<int>(type: "int", nullable: false),
                    LogComId = table.Column<int>(type: "int", nullable: false),
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_tbOrderInfos", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "tbSaleNums",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    OrderInfoId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CommodityId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SaleNumState = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    SaleNumber = table.Column<int>(type: "int", nullable: false),
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_tbSaleNums", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "tbOrderInfos");

            migrationBuilder.DropTable(
                name: "tbSaleNums");
        }
    }
}
